home *** CD-ROM | disk | FTP | other *** search
- /* $VER: Dashboard 1.3 (30.05.96) (c) Neil Bothwick */
- /* Central interface for Wirenet Internet operation */
-
- options results
-
- GuiFile = 'AmiTCP:dashboard.gui'
- cr = '0a'x
- pragma('Directory','AmiTCP:bin')
-
- if ~show('L','rexxsupport.library') then
- if ~addlib('rexxsupport.library',0,-30) then exit
-
- if ~show('L','rexxdossupport.library') then
- if ~addlib('rexxdossupport.library',0,-30) then exit
-
- if ~show('L','rexxreqtools.library') then
- if ~addlib('rexxreqtools.library',0,-30) then exit
-
- /* Load Varexx if necessary */
-
- if ~show('P','VAREXX') then do
- VarexxStarted = 'Yes'
- address command 'Varexx'
- address command 'WaitForPort VAREXX'
- end
-
- address VAREXX
-
- call openport('DashPort')
-
- 'load' GuiFile 'DashPort'
- host = result
- address value host
-
- show 'Dashboard'
- call EnableAll(1)
- Busy SET
- address command 'StartNet'
- Busy
-
- do forever
- call waitpkt('DashPort')
- packet = getpkt('DashPort')
- Action = getarg(packet)
-
- select
- when Action = 'CONNECT' then call Connect
- when Action = 'DISCONNECT' then call Disconnect
- when Action = 'GET' then call Get
- when Action = 'BROWSE' then call Browse
- when Action = 'FTP' then call FTP
- when Action = 'WWW' then call WWW
- when Action = 'READ' then call Read
- when Action = 'EXIT' then call Exit(0)
- when Action = 'QUIT' then call Exit(1)
- when Action = 'CLOSEWINDOW' then call Exit(0)
- when Action = 'TITLE' then call About
- otherwise nop
- end
- end
-
- exit
-
-
- EnableAll:
- arg flag
- GadList = 'TITLE CONNECT CONNECTTYPE DISCONNECT DISCONNECTTYPE GET GETTYPE WWW FTP BROWSE READ EXIT QUIT'
- if flag = 1 then
- do i = 1 to words(GadList)
- set word(GadList,i) enable
- end
- else
- do i = 1 to words(GadList)
- set word(GadList,i) disable
- end
- return
-
- Connect:
- Busy SET
- read CONNECTTYPE
- ConType = result
- address command
- select
- when upper(GetVar(NetState)) = 'ONLINE' then call Request('You are already connected')
- when ConType = 0 then 'Connect'
- when ConType = 1 then 'Connect Mail'
- when ConType = 2 then 'Connect News'
- when ConType = 3 then 'Connect AutoMail'
- when ConType = 4 then 'Connect AutoNews'
- otherwise nop
- end
- address
- Busy
- return
-
- Disconnect:
- Busy SET
- read DISCONNECTTYPE
- DisconType = result
- address command
- if DisconType = 0 then 'Connect Off'
- else 'Connect AutoOff'
- address
- Busy
- return
-
- FTP:
- Busy SET
- address command 'Run >NIL: AmiTCP:AmiFTP'
- Busy
- return
-
- WWW:
- Busy SET
- address command 'Run >NIL: AmiTCP:AWeb/AWeb'
- Busy
- return
-
- Get:
- Busy SET
- read GETTYPE
- FetchType = result
- address command
- select
- when FetchType = 0 then 'run >NIL: Fetch Mail'
- when FetchType = 1 then 'run >NIL: Fetch News'
- when FetchType = 2 then 'run >NIL: Fetch All'
- otherwise nop
- end
- address
- Busy
- return
-
- Read:
- Busy SET
- address command 'run >NIL: run >nil: `GetEnv THOR/THORPath`Thor System=Wirenet FF'
- Busy
- return
-
- Browse:
- if upper(GetVar(NetState)) ~= 'ONLINE' then do
- call Request('You need to be connected'||cr||' to use this function')
- return
- end
- Busy SET
- address command 'run >NIL: run >nil: `GetEnv THOR/THORPath`ConnectThor'
- Busy
- return
-
- Exit:
- parse arg Quit
- Busy SET
- if Quit = 1 & upper(GetVar(NetState)) = 'ONLINE' then do
- if rtezrequest('This will disconnect you!'||cr||'Are you sure?',' _Yes |_No',,'rtez_defaultresponse=0') = 1 then call Disconnect
- else do
- Busy
- return
- end
- end
- 'hide UNLOAD'
- call closeport('DashPort')
- if VarexxStarted = 'Yes' then address command 'SYS:Rexxc/VXC'
- if Quit = 1 then address Command 'StopNet'
- exit
- return
-
- About:
- Busy SET
- AboutMsg = 'Wirenet Dashboard (c) Neil Bothwick, 1996'cr|| cr'Created using Varexx by Andy Cook'cr'GadToolsBox by Jan van den Baard'
- if rtezrequest(AboutMsg,' _OK |_Help',,'rt_reqpos=reqpos_centerwin') = 0 then
- address command 'Multiview AmiTCP:doc/Dashboard.guide'
- Busy
- return
-
- Request:
- parse arg Message
- call rtezrequest(Message,' _OK ')
- return
-
-